# Is Unique: Implement an algorithm to determine if a string has all unique characters. What if you
# cannot use additional data structures?

#With Data Structure
def isUniqueDS(word):
    map = [None]*127
    for x in word:
        if map[ord(x)] == x:
            return False
        else: map[ord(x)] = x
    return True

print(isUniqueDS('Hello'))


# Without Data Structure
def isUnique(word):
    word_sort = (sorted(word))
    for x in range(len(word_sort)):
        if word_sort[x] == word_sort[x-1]:
            return False
    return True

# print(isUnique('Hello'))